window._MANAGERFIGHTCITY = {

    _CITY:null,
    _TARGET:null,


    showSelect:function(parentNode,cityName,target,param){


        var selectObj = _GRM.getNodeObj('fightCitySelect');
        var selectUi = selectObj.node;
        _MANAGERFIGHTCITY._CITY = cityName;
        _MANAGERFIGHTCITY._TARGET = target;

        if(selectObj.isnew){

            selectUi.getChildByName('mask').on(cc.Node.EventType.TOUCH_START, function(){
                _GRM.putNode(this);
            }, selectUi);

            selectUi.getChildByName('ui')
            .getChildByName('btnBuy').on(cc.Node.EventType.TOUCH_START, function(){
                //_TIPS.showMessage('买通');
                var goldnmb = _GAMEDATAHELPER.getMoney();
                if(goldnmb*0.1<10000){
                    _TIPS.showMessage('买路钱不能低于10000');
                }else{
                    _GRM.putNode(this);
                    var needgold = Math.floor(goldnmb*0.1);
                    if(needgold<10000){
                        needgold=10000;
                    }
                    _GAMEDATAHELPER.oprMoney(-needgold);
                    _MAP.jumpToMap(_MANAGERFIGHTCITY._CITY,_MANAGERFIGHTCITY._TARGET);
                }

            }, selectUi);
            selectUi.getChildByName('ui')
            .getChildByName('btnFight').on(cc.Node.EventType.TOUCH_START,  function(){
                //_TIPS.showMessage('战斗');
                var fightLevel = _CU.getLevelOfArr(_HONOUR._EXP,window.gameData.levelFight);
                var masterBoss = _PLAYERSTATUS.getMasterBossOfPlayer();
                var masterConf = _NPC[masterBoss];

                /*
                if(
                    window.gameData.isMaster
                    ||(masterConf&&masterConf.title<=fightLevel)
                    ||fightLevel>=5
                ){
                    _GRM.putNode(this);
                    _FIGHTPREPARE.initCityFight(_MANAGERFIGHTCITY._CITY,_MANAGERFIGHTCITY._TARGET);
                }else{
                    _TIPS.showMessage('官职'+_HONOUR._TITLE1[5]+'/'+_HONOUR._TITLE2[5]+'以上或者不小于本势力主公官职才可以攻城');
                }
                */

                _GRM.putNode(this);
                _FIGHTPREPARE.initCityFight(_MANAGERFIGHTCITY._CITY,_MANAGERFIGHTCITY._TARGET);

            }, selectUi);
            selectUi.getChildByName('ui')
            .getChildByName('btnHide').on(cc.Node.EventType.TOUCH_START, function(){
                //_TIPS.showMessage('嵌入');
                if(_GAMEDATAHELPER.hasTeamSkill('qianru')){
                    _GRM.putNode(this);
                    _MAP.jumpToMap(_MANAGERFIGHTCITY._CITY,_MANAGERFIGHTCITY._TARGET);
                }else{
                    _TIPS.showMessage('需要解锁异能《潜行》');
                }
            }, selectUi);
        }

        parentNode.addChild(selectUi);
    }


}